home *** CD-ROM | disk | FTP | other *** search
/ Light ROM 2 / LIGHT-ROM 2 (Amiga Library Services)(1995).iso / als / amigalib.mk next >
Makefile  |  1995-03-23  |  4KB  |  129 lines

  1. # Amiga Library Services - CD Administration Makefile
  2. #
  3. # This Makefile is envoked from the root directory of the CD-ROM
  4. # master file tree and is responsible for doing such things as:
  5. #
  6. #   *    Building the automatically generated files for the release.
  7. #
  8. #   *    "Cleaning up" the file tree.
  9.  
  10.  
  11. # These things will probably need to be changed with each CD release
  12. # or whenever the host system changes configuration.
  13.  
  14. CDNAME =    LR
  15. VOLNAME =    $(CDNAME)
  16. IMAGE =        ISO2:$(VOLNAME).iso
  17.  
  18. # These things will probably remain constant across CD releases.
  19.  
  20. PUBLISHER =    "Amiga Library Services - (602) 491-0048"
  21. PREPARER =    "Fred Fish"
  22.  
  23. MAKE =        make
  24. SHELL =        /bin/sh
  25.  
  26. # The default thing to do is nothing, except to suggest things that
  27. # can be done.        
  28.  
  29. all:
  30.     @echo "rerun make with one of:"
  31.     @echo "  [iso, rebuild, FILELIST, CRCLIST]"
  32.  
  33. # This target will rebuild all the machine generated files, after doing
  34. # a "make clobber".
  35.  
  36. rebuild: ALS/DIRLIST ALS/FILELIST ALS/CRCLIST
  37.  
  38. # -a    Include all files
  39. # -A    Map filenames to ISO compliant file names.
  40. # -c    Do not convert filenames
  41. # -e    Sort file extents by common extensions.
  42. # -r    Inhibit relocation of directories.
  43. # -R    Enable RockRidge extensions.
  44. # -T    Generate a file TRANS.TBL to make ISO names to original names.
  45.  
  46. iso:    ALS/CRCLIST
  47.     mkisofs -a -c -e -r -o $(IMAGE) -P $(PUBLISHER) -p $(PREPARER) \
  48.       -V $(VOLNAME) $(VOLNAME):
  49.  
  50. # Build the DIRLIST, FILELIST and CRCLIST files.  Note that we ensure
  51. # that a FILELIST and CRCLIST file exist by touching them before building
  52. # the updated FILELIST, and then removing the CRCLIST file (even a
  53. # previously existing one) after building the new FILELIST, since the
  54. # CRCLIST needs to be rebuilt anyway if the FILELIST is touched.  However
  55. # since we can't compute a CRC for the CRC file itself without major
  56. # trickery, the CRCLIST is generated using a copy of FILELIST that has
  57. # had the CRCLIST line removed.  All these gyrations ensure that the
  58. # FILELIST file includes entries for both itself and the CRCLIST file,
  59. # while the CRCLIST file contains no entry for itself.
  60. #
  61. # Also note that the output is stored in a temporary file on a different
  62. # volume, so as to avoid problems on the Amiga with "find" trying to
  63. # lock CRCLIST while it is open for write.
  64.  
  65. ALS/DIRLIST:
  66.     find . -type d -print | sort | sed -e "s:^./::" -e "/^\.$$/d" >/tmp/DIRLIST
  67.     cp /tmp/DIRLIST $@
  68.     rm -f /tmp/DIRLIST
  69.  
  70. ALS/FILELIST: ALS/DIRLIST
  71.     touch $@ ALS/CRCLIST
  72.     find . -type f -print | sort | sed "s:^./::" >/tmp/FILELIST
  73.     cp /tmp/FILELIST $@
  74.     rm -f /tmp/FILELIST ALS/CRCLIST
  75.  
  76. ALS/CRCLIST: ALS/FILELIST
  77.     sed "/^ALS\/CRCLIST$$/d" <ALS/FILELIST >/tmp/FILELIST
  78.     brik -Gvbf /tmp/FILELIST >$@
  79.  
  80. # Clean out the machine generated files in preparation for rebuilding them.
  81.  
  82. clobber: clean
  83.     rm -f ALS/DIRLIST ALS/FILELIST ALS/CRCLIST
  84.     
  85. clean:
  86.     rm -f *! *~
  87.  
  88. # Update all hardwired device names in LoadObject commands prior to releasing
  89. # a new version of this CD for which the volume name changes.  Note that we
  90. # restrict ourselves to LoadObject commands that start a line, which helps us
  91. # to avoid changing *this* file as well!
  92.  
  93. fix:    ALS/FILELIST
  94.     -cat ALS/FILELIST | xargs grep -li "^[ \t]*LoadObject[ \t]*.*:" >/tmp/LoadObject.list
  95.     for i in `cat /tmp/LoadObject.list`; do \
  96.         echo -n "Checking $$i ... "; \
  97.         sed "s@LoadObject[ \t]*.*:@LoadObject $(CDNAME):@" <$$i >/tmp/tmpfile; \
  98.         if cmp $$i /tmp/tmpfile >/dev/null; then \
  99.             echo "not changed."; \
  100.         else \
  101.             mv $$i $$i.orig; \
  102.             cp /tmp/tmpfile $$i; \
  103.             echo "fixed."; \
  104.         fi; \
  105.     done
  106.     cat /tmp/LoadObject.list | xargs grep -i LoadObject | grep -v $(CDNAME)
  107.     rm -f /tmp/LoadObject.list
  108.  
  109.  
  110. # Examine the FILELIST and gripe about any names that are not strictly
  111. # MS-DOS conformant (8.3, uppercase alphanumeric, etc).
  112.  
  113. dosnames: ALS/FILELIST
  114.     -doschk <ALS/FILELIST
  115.     -grep "[^A-Z_0-9./]" <ALS/FILELIST >/tmp/badchars
  116.     -if test -s /tmp/badchars ; then \
  117.         echo; \
  118.         echo "WARNING - The following pathnames contain illegal MS-DOS characters:"; \
  119.         cat /tmp/badchars; \
  120.     fi
  121.     rm -f /tmp/badchars
  122.     -grep "[A-Z_0-9][A-Z_0-9][A-Z_0-9][A-Z_0-9][A-Z_0-9][A-Z_0-9][A-Z_0-9][A-Z_0-9][A-Z_0-9]" <ALS/FILELIST >/tmp/TooLong
  123.     -if test -s /tmp/TooLong ; then \
  124.         echo; \
  125.         echo "WARNING - The following pathnames contain prefixes or suffixes over 8 characters long:"; \
  126.         cat /tmp/TooLong; \
  127.     fi
  128.     rm -f /tmp/TooLong
  129.